﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace CH.Easy.Utility
{
    public class FileHelper
    {
        public static string GetFileByString(string path)
        {
            string text = string.Empty;
            try
            {
                FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read);
                StreamReader sr = new StreamReader(fs);
                text = sr.ReadToEnd();
                sr.Close();
                sr.Dispose();
                fs.Close();
                fs.Dispose();
                return text;
            }
            catch (Exception ex)
            {
                text = ex.Message;
            }
            return text;
        }

    }
}
